<?php
Route::group(['namespace' => 'Admin','prefix' => '/admin',], function () {
    Route::get('login','AdminController@login');
    Route::post('postLogin','AdminController@postLogin');
    Route::get('logout','AdminController@logout');
    Route::group(['middleware'=>'adminAuth','auth','menu'],function(){
        Route::any('user/index', ['as' => 'admin.user.index', 'uses' => 'UserController@index']);
        Route::get('user/create', 'UserController@create');
        Route::post('user/update/{id}', 'UserController@update');
        Route::get('user/{id}/edit', 'UserController@edit');
        Route::post('user/update', ['as' => 'admin.user.edit', 'uses' => 'UserController@update']); //修改
        Route::post('user/store', ['as' => 'admin.user.create', 'uses' => 'UserController@store']); //添加
        Route::any('user/destroy/{id}', 'UserController@destroy');
    });
});
//api
Route::group(['prefix' => 'api','namespace' => 'Api'],function()
{
    Route::any('/addReader','ShareController@addReader');//增加读者
    Route::post('/nearest','ShareController@nearest');//最近的书柜
    Route::post('/shelfList','ShareController@shelfList');//地图列表页
    Route::post('/bookList','ShareController@bookList');//图书列表
    Route::post('/bookDetail','ShareController@bookDetail');//图书详情
    Route::post('/sendContent','BookController@sendContent');//读者扫码
    Route::post('/buyBook','ShareController@buyBook');//读者买书
    Route::post('/allShelf','ShareController@allShelf');
    Route::post('/allBook','ShareController@allBook');
    Route::post('/ifOpen','ShareController@ifOpen');
    Route::post('/addShelf','ShareController@addShelf');//添加漂流柜
    Route::post('/nowBorrow','ShareController@nowBorrow');//当前借阅
    Route::post('/hadBorrow','ShareController@hadBorrow');//历史借阅

    Route::post('/delContent','BookController@delContent');
    Route::post('/addMemberBook','BookController@addMemberBook');
    Route::post('/close','BookController@close');
    Route::post('/backBook','BookController@backBook');
    Route::post('/backBookBox','BookController@backBookBox');
    Route::post('/bookBoxStatus','BookController@bookBoxStatus');
    Route::post('/dueClose','BookController@dueClose');
    Route::post('/openDoor','BookController@openDoor');

    Route::any('/login','VerifyController@login');//登录接口
    Route::any('/check','VerifyController@check');//验证接口
    Route::any('/sendMsg','SmsController@sendRegister');//短信接口
    Route::any('/smsWap','SmsController@sendWapRegister');//m站短信接口
});

Route::group(['prefix'=>'upload','namespace'=>'Back'],function(){
    Route::post('img','UploadController@img');
    Route::post('file','UploadController@file');
});

Route::group(['prefix' => 'back','namespace' => 'Back'],function()
{
    Route::get('/','IndexController@console')->name('login');
    Route::get('/index','IndexController@index')->name('adminHome');
    Route::get('/applist','IndexController@applist')->name('applist');
    Route::get('/account','IndexController@account')->name('account');  //账号信息
    Route::any('/editpwd','IndexController@editpwd')->name('editpwd');  //修改密码

    Route::group(['prefix' => 'user'],function(){
        Route::get('/', 'UserController@index')->name('userList');//管理员列表
        Route::any('/create', 'UserController@create')->name('addUser');//添加管理员
        Route::any('/edit/{id}', 'UserController@edit')->name('editUser');//编辑保存管理员
        Route::get('/able/{id}/{able}','UserController@able')->name('userStatus');//启用禁用
        Route::get('/delete/{id}','UserController@delete')->name('deleteUser');//删除
    });
    //用户帐号
    Route::group(['prefix' => 'member'],function(){
        Route::get('/','MemberController@index')->name('memberList');//用户列表
        Route::any('/edit/{id}', 'MemberController@edit')->name('editMember');//编辑用户
        Route::get('/able/{id}/{able}', 'MemberController@able')->name('memberStatus');//启用禁用
        Route::get('/memberBook/{id}','MemberController@memberBook');//用户图书列表
        Route::get('/deleteMember/{id}','MemberController@deleteMember');//删除
        Route::any('/create','MemberController@create');
    });

    //书籍仓库和待上架书籍
    Route::group(['prefix' => 'book'],function(){
        Route::get('/','BookController@index')->name('sceneryList');//图书列表
        Route::any('/edit/{id}', 'BookController@edit');//编辑图书
        Route::get('/delete/{id}','BookController@delete');//删除
        Route::post('/pull1','BookController@pull');
        Route::post('/pull','BookController@pull');
        Route::post('/pull3','BookController@pull3');
        Route::get('/bookType','BookController@bookType');//图书类型列表
        Route::any('/createType', 'BookController@createType');
        Route::any('/editType/{id}', 'BookController@editType');//编辑图书类型
        Route::get('/deleteType/{id}','BookController@deleteType');//删除
        Route::get('/secCata/{id}','BookController@secCata');
        Route::get('/thirdCata/{id}','BookController@thirdCata');
        Route::any('/editSecCata/{id}', 'BookController@editSecCata');
        Route::any('/editThirdCata/{id}', 'BookController@editThirdCata');
        Route::get('/deleteThirdCata/{id}','BookController@deleteThirdCata');//删除
        Route::post('/dcThirdCata/{id}','BookController@dcThirdCata');
        Route::post('/pldcThirdCata','BookController@pldcThirdCata');
        Route::post('/pldcSecCata','BookController@pldcSecCata');
        Route::post('/pldcCata','BookController@pldcCata');
        Route::post('/page','BookController@page');
        Route::post('/plhkCollect','BookController@plhkCollect');
        Route::post('/plhkSecCollect','BookController@plhkSecCollect');
        Route::post('/plhkThirdCollect','BookController@plhkThirdCollect');
        Route::get('/collect','BookController@collect');
        Route::any('/edit2/{id}', 'BookController@edit2');//编辑图书
        Route::get('/secCollect/{id}','BookController@secCollect');
        Route::get('/thirdCollect/{id}','BookController@thirdCollect');
        Route::any('/editSecCollect/{id}', 'BookController@editSecCollect');
        Route::any('/editThirdCollect/{id}', 'BookController@editThirdCollect');
        Route::post('/xjThirdCollect/{id}','BookController@xjThirdCollect');
        Route::any('/SjThirdCollect/{id}', 'BookController@SjThirdCollect');
    });
    Route::group(['prefix' => 'ltBook'],function(){
        Route::get('/index','LtBookController@index');
        Route::any('/edit/{id}', 'LtBookController@edit');
        Route::get('/secLt/{id}','LtBookController@secLt');
        Route::get('/thirdLt/{id}','LtBookController@thirdLt');
        Route::any('/editSecLt/{id}', 'LtBookController@editSecLt');
        Route::any('/editThirdLt/{id}', 'LtBookController@editThirdLt');
        Route::post('/ghThirdLt/{id}','LtBookController@ghThirdLt');
    });
    Route::group(['prefix' => 'sjBook'],function(){
        Route::get('/index','SjBookController@index');
        Route::any('/edit/{id}', 'SjBookController@edit');
        Route::get('/secSj/{id}','SjBookController@secSj');
        Route::get('/thirdSj/{id}','SjBookController@thirdSj');
        Route::any('/editSecSj/{id}', 'SjBookController@editSecSj');
        Route::any('/editThirdSj/{id}', 'SjBookController@editThirdSj');
        Route::post('/xjThirdSj/{id}','SjBookController@xjThirdSj');
    });
    Route::group(['prefix' => 'xjBook'],function(){
        Route::get('/index','XjBookController@index');
        Route::any('/edit/{id}', 'XjBookController@edit');
        Route::get('/secXj/{id}','XjBookController@secXj');
        Route::get('/thirdXj/{id}','XjBookController@thirdXj');
        Route::any('/editSecXj/{id}', 'XjBookController@editSecXj');
        Route::any('/editThirdXj/{id}', 'XjBookController@editThirdXj');
        Route::post('/dcThirdXj/{id}','XjBookController@dcThirdXj');
        Route::post('/hkThirdXj/{id}','XjBookController@hkThirdXj');
        Route::post('/plhkXj','XjBookController@plhkXj');
        Route::post('/plhkSecXj','XjBookController@plhkSecXj');
        Route::post('/plhkThirdXj','XjBookController@plhkThirdXj');
        Route::post('/pldcXj','XjBookController@pldcXj');
        Route::post('/pldcSecXj','XjBookController@pldcSecXj');
        Route::post('/pldcThirdXj','XjBookController@pldcThirdXj');
    });
    Route::group(['prefix' => 'wsBook'],function(){
        Route::get('/index','WsBookController@index');
        Route::any('/edit/{id}', 'WsBookController@edit');
        Route::get('/secWs/{id}','WsBookController@secWs');
        Route::get('/thirdWs/{id}','WsBookController@thirdWs');
        Route::any('/editSecWs/{id}', 'WsBookController@editSecWs');
        Route::any('/editThirdWs/{id}', 'WsBookController@editThirdWs');
    });
    Route::group(['prefix' => 'ycBook'],function(){
        Route::get('/index','YcBookController@index');
        Route::any('/editThirdYc/{id}', 'YcBookController@editThirdYc');
        Route::post('/deleteYc/{id}','YcBookController@deleteYc');
    });
    Route::group(['prefix' => 'ltlog'],function(){
        Route::get('/index','LtLogController@index');
        Route::post('/ghcol/{id}','LtLogController@ghcol');
        Route::post('/gh','LtLogController@gh');

    });
    //漂流柜管理
    Route::group(['prefix' => 'shelf'],function(){
        Route::get('/','ShelfController@index')->name('functionList');//景区规则列表
        Route::get('/create','ShelfController@create');//添加景区规则
        Route::any('/edit/{id}', 'ShelfController@edit');//编辑漂流柜
        Route::post('/save/{id}','ShelfController@save');
        Route::get('/doorList/{id}','ShelfController@doorList');//柜门列表
        Route::post('/yieldDoors', 'ShelfController@yieldDoors');//生成柜门
        Route::get('/doorBooks/{id}', 'ShelfController@doorBooks');//门书列表
        Route::get('/delete/{id}','ShelfController@delete')->name('deleteFunction');//删除
        Route::get('/able/{id}/{able}','FunctionController@able')->name('functionStatus');//启用禁用
    });
    //地区
    Route::group(['prefix' => 'region'],function(){
        Route::get('/','RegionController@index')->name('sceneryRegionList');//景区地区分类列表
        Route::any('/create','RegionController@create')->name('addSceneryRegion');//添加景区地区分类
        Route::any('/edit/{id}', 'RegionController@edit')->name('editSceneryRegion');//编辑景区地区分类
        Route::get('/delete/{id}','RegionController@delete')->name('deleteSceneryRegion');//删除
//        Route::get('/able/{id}/{able}','SceneryRegionController@able')->name('sceneryRegionStatus');//启用禁用
    });
});






